﻿@{
ViewBag.Title = "品牌";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@section mystyle{
<style>
  .table>tbody>tr>td {
    line-height: 34px;
  }

</style>
}

<!-- table -->
<div class="padding-top-10 padding-bottom-10 margin-top-20">
  <div class="container">
    <div class="row">

      <div id="table" class="col-sm-12 margin-top-20">
        <table class="table text-center" id="listTable">
          <thead>
          <tr>
            <th></th>
            <th>名称</th>
            <th>缩写</th>
            <th>说明</th>
            <th>操作</th>
          </tr>
          </thead>
          <tbody>
            <tr v-for="item in brandList">
              <td>{{$index + 1}}</td>
              <td><input type="text" class="form-control" v-model="item.Text" v-bind:disabled="!item.edit"></td>
              <td><input type="text" class="form-control" v-model="item.Logogram" v-bind:disabled="!item.edit"></td>
              <td><input type="text" class="form-control" v-model="item.Explain" v-bind:disabled="!item.edit"></td>
              <td>

                <button type="button" v-show="!item.edit" class="btn btn-primary edit" v-on:click="edit($index)"><span class="glyphicon glyphicon-edit"></span></button>

                <button type="button" v-show="item.edit" class="btn btn-success update" v-on:click="update($index)"><span class="glyphicon glyphicon-ok-circle"></span></button>
                <button type="button" v-show="item.edit" class="btn btn-warning" v-on:click="edit($index)"><span class="glyphicon glyphicon-remove-circle"></span></button>

                <button type="button" v-show="!item.edit" class="btn btn-danger remove" v-on:click="remove($index)"><span class="glyphicon glyphicon-minus"></span></button>
              </td>
            </tr>
            <tr>
              <td>{{brandList.length + 1}}</td>
              <td><input type="text" class="form-control" v-model="form.Text"></td>
              <td><input type="text" class="form-control" v-model="form.Logogram"></td>
              <td><input type="text" class="form-control" v-model="form.Explain"></td>
              <td>
                <button type="button" class="btn btn-success add" v-on:click="add()"><span class="glyphicon glyphicon-plus"></span></button>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</div>

@section myscript{
<script src="~/Content/vendor/vue/vue.min.js"></script>
<script src="~/Content/js/brandop.js"></script>
}